home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 5 / Apprentice-Release5.iso / Source Code / PowerPlant / AGA Classes 1.2 / Text / LAGAEditField.h < prev    next >
Encoding:
Text File  |  1996-06-30  |  3.9 KB  |  95 lines  |  [TEXT/CWIE]

  1. // ===========================================================================
  2. //    LAGAEditField.h
  3. // ===========================================================================
  4. //    “Apple Grayscale Appearance” compliant Text Entry Field
  5. //    Copyright © 1996 Chrisoft (Christophe ANDRES)  All rights reserved.
  6. //
  7. //    You may use this source code in any application (commercial, shareware, freeware,
  8. //    postcardware, etc), but not remove this notice (no need to acknowledge the use of
  9. //    this class in the about box)
  10. //    You may not sell this source code in any form. This source code may be placed on 
  11. //    publicly accessable archive sites and source code disks. It may not be placed on 
  12. //    profit archive sites and source code disks without the permission of the author, 
  13. //    Christophe ANDRES.
  14. //    
  15. //        This source code is distributed in the hope that it will be useful,
  16. //        but WITHOUT ANY WARRANTY; without even the implied warranty of
  17. //        MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  18. //
  19. //    If you make any change or improvement on this class, please send the improved/changed
  20. //    version to : chrisoft@calva.net or Christophe ANDRES
  21. //                                     20, rue Prosper Mérimée
  22. //                                     67100 STRASBOURG
  23. //                                     FRANCE
  24. //
  25. // ===========================================================================
  26. //    LAGAEditField.cp            <- double-click + Command-D to see class implementation
  27. //
  28. //    LAGAEditField is my implementation of the “Apple Grayscale Appearance for System 7.5”
  29. //        Text Entry field. It handles the 3D effect, but is also designed to work effectively
  30. //        with a class like LAGAIndexTab. In an index tab, a Text Entry Field can be present but
  31. //        in another Index Tab, and should therefore not be selected when the user presses the
  32. //        “Tab” key. Also if the Index Tab is changed and a Text Entry Field is revealed it should
  33. //        be selected. LAGAEditField handles all these cases.
  34. //        LAGAEditField keeps its own background in white, whatever the window background may be.
  35. //
  36. //        This class requires AGAColors.cp to be present in your project
  37. //
  38. //        Version : 1.2
  39. //
  40. //        Change History (most recent first, date in US form : mm/dd/yy):
  41. //
  42. //                        06/30/96    ca        Public release of version 1.2
  43. //                        06/04/96    ca        Added RegisterClass method to ease registry
  44. //                                                        Added guard macros in header files
  45. //                                                        Increased version to 1.2
  46. //                        05/20/96    ca        Increased version to 1.1
  47. //                                                        Added copy constructor
  48. //                                                        Added "on the fly" constructor
  49. //                                                        Added change history
  50. //                        05/10/96    M™H        Changes by Michael(tm) Hamel <mhamel@adi.co.nz>
  51. //                                                        Corrected the fact that LAGAEditField used to draw outside of its frame, which is a problem
  52. //                                                            if you Hide() it.
  53. //                                                        Note : You might need to increase slightly (2 pixels) the height of objects created with
  54. //                                                                        version 1.0
  55. //                        04/22/96    ca        class made available by Christophe ANDRES <chrisoft@calva.net>
  56. //                                                        (version 1.0)
  57. //
  58. //        To Do:
  59. //
  60.  
  61. #ifndef _H_LAGAEditField
  62. #define _H_LAGAEditField
  63. #pragma once
  64.  
  65. #include    <LEditField.h>
  66.  
  67. class LAGAEditField : public LEditField
  68. {
  69.     public        :
  70.         enum { class_ID = 'AGAe' };
  71.         static void RegisterClass ();                                                                                                                                                    //    <06/04/96    ca>
  72.         static LAGAEditField* CreateAGAEditFieldStream (LStream *inStream);
  73.     
  74.         LAGAEditField (LStream *inStream);
  75.         
  76.         LAGAEditField (const LAGAEditField &inOriginal);
  77.         
  78.         LAGAEditField (const SPaneInfo &inPaneInfo, Str255 inString, ResIDT inTextTraitsID,
  79.                                         Int16 inMaxChars, Boolean inHasBox, Boolean inHasWordWrap,
  80.                                         KeyFilterFunc    inKeyFilter, LCommander *inSuper);
  81.         
  82.         virtual Boolean ObeyCommand (CommandT inCommand, void* ioParam);
  83.         
  84.         virtual void SpendTime (const EventRecord    &inMacEvent);
  85.     
  86.     protected    :
  87.         virtual void DrawBox ();
  88.         
  89.         void DrawSelf ();
  90.         void AlignTextEditRects ();
  91.         void AdjustTextWidth (Boolean inShrinkToText);
  92. };
  93.  
  94. #endif
  95.